package lab02.test11;

public class Rectangle implements Printx{
    private int width;
    private int height;

    public double Area(){
        return width*height;
    }

    private double Perimeter(){
        return 2*width+2*height;
    }

    @Override
    public void printMyWay() {
        System.out.println("宽："+width+"\n"+"高："+height+"\n"+"面积："+Area()+"\n"+"周长："+Perimeter());
    }

    Rectangle(){}
    Rectangle(int width,int height){
        this.width = width;
        this.height = height;
    }

    public int getWidth() {
        return width;
    }

    public void setWidth(int width) {
        this.width = width;
    }

    public int getHeight() {
        return height;
    }

    public void setHeight(int height) {
        this.height = height;
    }
}
